package com.luoc.service;

import com.luoc.service.impl.BeginState;
import com.luoc.service.impl.EndState;

/**
 * @Author: luoc
 * @Date: 2019/10/10 16:15
 */
public class Context {

    private State state;

    private int stateType;

    public State getState() {
        return state;
    }

    public int getStateType() {
        return stateType;
    }

    public void setStateType(int stateType) {
        this.stateType = stateType;
    }

    public void setState(State state) {
        this.state = state;
    }

    public void resquest(){
        state.handle();
    }

    public void changeState(){
            if (stateType == 1){
                this.setState(new BeginState());
            }else if (stateType == 2){
                this.setState(new EndState());
            }


    }
}
